#ifndef _INMENUSTATE_H_
#define _INMENUSTATE_H_

#include "GameState.hpp"
#include "Singleton.hpp"


///////////////////////////////////////////////////////
/// \brief State in which the game is when the player
///        is in the menu.
///
/// This state is the first state used when starting the game.
/// In this state, the player cannot play yet.
///
/// \note Singleton class.
///
///////////////////////////////////////////////////////
class InMenuState : public GameState, public Singleton<InMenuState>
{
    friend class Singleton<InMenuState>;

public:
    ///////////////////////////////////////////////////////
    /// \brief Destructor
    ///
    ///////////////////////////////////////////////////////
    ~InMenuState ();

    ///////////////////////////////////////////////////////
    /// \brief Initializes the state.
    ///
    ///////////////////////////////////////////////////////
    virtual void init();

    ///////////////////////////////////////////////////////
    /// \brief Resets the state.
    ///
    ///////////////////////////////////////////////////////
    virtual void reset();

    ///////////////////////////////////////////////////////
    /// \brief Handles the user events.
    ///
    /// - The escape key quits the game.
    /// - The "1" key starts the game
    ///
    ///////////////////////////////////////////////////////
    virtual void handleEvents();

    ///////////////////////////////////////////////////////
    /// \brief Updates the game content.
    ///
    ///////////////////////////////////////////////////////
    virtual void update();

    ///////////////////////////////////////////////////////
    /// \brief Render the game content.
    ///
    ///////////////////////////////////////////////////////
    virtual void render();

private:
    ///////////////////////////////////////////////////////
    /// \brief Create the "in menu" state from the game
    ///        and its rendering window.
    ///
    /// \param game Game the state must act on.
    /// \param window Window on which the game is rendered.
    ///
    ///////////////////////////////////////////////////////
    InMenuState (Game* game, sf::RenderWindow* window);

    virtual void loadTextures() const;
    virtual void loadTexture(sf::Texture* texture,
                             const std::string& fileName,
                             const std::string& textureName) const;

    virtual void loadSprites() const;
};

#endif /* _INMENUSTATE_H_ */
